﻿using System;
using ExFlash.Records;

namespace ExFlash.Filters
{
    public class DropShadowFilter : ISwfSerializable
    {
        public RGBARecord DropShadowColor
        {
            get;
            private set;
        }

        public FixedFloatRecord BlurX
        {
            get;
            private set;
        }

        public FixedFloatRecord BlurY
        {
            get;
            private set;
        }

        public FixedFloatRecord Angle
        {
            get;
            private set;
        }

        public FixedFloatRecord Distance
        {
            get;
            private set;
        }

        public FixedFloat8Record Strength
        {
            get;
            private set;
        }

        public Boolean InnerShadow
        {
            get;
            private set;
        }

        public Boolean Knockout
        {
            get;
            private set;
        }

        public Boolean CompositeSource
        {
            get;
            private set;
        }

        public Byte Passes
        {
            get;
            private set;
        }

        #region ISwfSerializable Members

        public void SwfDeserialize(BinaryBitReader reader)
        {
            DropShadowColor = new RGBARecord();
            DropShadowColor.SwfDeserialize(reader);
            
            BlurX = new FixedFloatRecord();
            BlurX.SwfDeserialize(reader);

            BlurY = new FixedFloatRecord();
            BlurY.SwfDeserialize(reader);

            Angle = new FixedFloatRecord();
            Angle.SwfDeserialize(reader);

            Distance = new FixedFloatRecord();
            Distance.SwfDeserialize(reader);

            Strength = new FixedFloat8Record();
            Strength.SwfDeserialize(reader);

            InnerShadow = reader.ReadBoolean();
            Knockout = reader.ReadBoolean();
            CompositeSource = reader.ReadBoolean();
            Passes = (byte)reader.ReadUInt32(5);
            reader.AlignBits();
        }

        public void SwfSerialize(byte[] arr, ref int offset)
        {
            throw new NotImplementedException();
        }

        #endregion
    }
}
